// 查询模板管理列表

import http from "@/api/config/http";
import { IQuery, ITableResponse } from "@/interface/IAxios";
import { ThemeComponents } from "./types";

export function listThemeComponents(query?: IQuery): Promise<ITableResponse<ThemeComponents>> {
  return http.request({
    url: "/theme/component/list",
    method: "get",
    params: query
  });
}
export const getThemeComponent = (id: string) => {
  return http.request({
    url: `/theme/component/${id}`,
    method: "get"
  });
};

export const deleteThemeComponents = (ids: string[]) => {
  return http.request({
    url: `/theme/component/${ids.join(",")}`,
    method: "delete"
  });
};

export const updateThemeComponent = (data: ThemeComponents) => {
  return http.request({
    url: `/theme/component/`,
    method: "put",
    data
  });
};
